﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Wicresoft.EKA.NRemedy
{
    public static class GlobalSettings
    {
        /// <summary>
        /// set Global CharacterEncoding 
        /// </summary>
        /// <param name="value">UTF8|UTF32|Unicode|ASCII|Default</param>
        public static void SetCharacterEncoding(string value)
        {
            if (value.Equals("UTF8", StringComparison.InvariantCultureIgnoreCase))
            {
                Global.CharacterEncoding = Encoding.UTF8;
            }
            else if (value.Equals("UTF32", StringComparison.InvariantCultureIgnoreCase))
            {
                Global.CharacterEncoding = Encoding.UTF32;
            }
            else if (value.Equals("Unicode", StringComparison.InvariantCultureIgnoreCase))
            {
                Global.CharacterEncoding = Encoding.Unicode;
            }
            else if (value.Equals("ASCII", StringComparison.InvariantCultureIgnoreCase))
            {
                Global.CharacterEncoding = Encoding.ASCII;
            }
            else
            {
                Global.CharacterEncoding = Encoding.Default;
            }
        }
    }

}
